{% extends 'TopxiaWebBundle::layout.html.twig' %}

{% block title %}{{'登录'|trans}} - {{ parent() }}{% endblock %}
{% set script_controller = 'auth/login-bind-exist' %}

{% block content %}
<div class="es-section login-section login-section-weixin">
  <div class="section-header">
    <h1>{{ name }}</h1>
  </div>
 <form id="bind-exist-form" class="form-vertical" method="post" action="{{ path('login_bind_exist', {type:type}) }}" data-goto="{% if hasPartnerAuth %}{{ path('partner_login') }}{% else %}{{ path('homepage') }}{% endif %}">
    <div class="alert alert-danger" id="bind-exist-form-error" style="display:none;"></div>

    {% if (setting('auth.register_mode') == 'mobile' or setting('auth.register_mode') == 'email_or_mobile') and setting('cloud_sms.sms_enabled') %}
    <div class="form-group mbl">
      <label class="control-label" for="bind-email-field">{{'Email / 手机'|trans}}</label>
        <div class="controls">
          <input id="bind-email-field" class="form-control" type="text" name="emailOrMobile">
          <p class="help-block">{{'请填写在%name%注册时填写的Email地址/手机号码'|trans({'%name%':setting('site.name')})}}</p>
        </div>
    </div>
    {% else %}
    <div class="form-group mbl">
      <label class="control-label" for="bind-email-field">{{'Email地址'|trans}}</label>
        <div class="controls">
          <input id="bind-email-field" class="form-control" type="email" name="emailOrMobile">
          <p class="help-block">{{'请填写在%name%注册时填写的Email地址'|trans({'%name%':setting('site.name')})}}</p>
        </div>
    </div>
    {% endif %}

    <div class="form-group mbl">
      <label class="control-label" for="bind-password-field">{{'密码'|trans}}</label>
        <div class="controls">
          <input id="bind-password-field" class="form-control" type="password" name="password">
        </div>
    </div>

    <div class="form-group">
      <div class="row">
        <div class="col-xs-6">
          <button class="btn btn-primary btn-lg btn-block" type="submit" data-loading-text="{{'正在提交'|trans}}...">{{'确认绑定'|trans}}</button>
        </div>
        <div class="col-xs-6">
          <a class="btn btn-default btn-lg btn-block" href="{{ path('login_bind_choose', {type: type}) }}">{{'绑定新帐号'|trans}}</a>
        </div>
      </div>
    </div>
    <input type="hidden" name="_csrf_token" value="{{ csrf_token('site') }}">
  </form>
</div>
{% endblock %}